/*
 * @Description:字段
 * @Author: iamsmiling
 * @Date: 2021-06-06 10:31:43
 * @LastEditTime: 2021-06-06 10:40:05
 */

// ignore: import_of_legacy_library_into_null_safe
import 'package:shake_animation_widget/shake_animation_widget.dart';

class TextFieldEntity {
  late String hintText;
  late String errorText;
  ShakeAnimationController controller = ShakeAnimationController();
  Function()? onFailure;
  Function()? onSuccess;
  Function()? onChanged;

  TextFieldEntity(
      {this.hintText = "",
      this.errorText = "",
      this.onFailure,
      this.onChanged,
      this.onSuccess}) {
    if (this.onFailure == null) {
      this.onFailure = () {
        hintText = errorText;
        controller.start(shakeCount: 1);
      };
    }
  }
}
